<div id="sends" class="vault">
  <div class="left-nav">
    <div class="vault-filters">
      <h2 class="sr-only">{{ "filters" | i18n }}</h2>
      <div class="filter">
        <ul class="filter-options">
          <li class="filter-option" [ngClass]="{ active: selectedAll }">
            <span class="filter-buttons">
              <button
                type="button"
                class="filter-button"
                (click)="selectAll()"
                [attr.aria-pressed]="selectedAll === true"
              >
                <i class="bwi bwi-fw bwi-filter" aria-hidden="true"></i>&nbsp;{{
                  "allSends" | i18n
                }}
              </button>
            </span>
          </li>
        </ul>
      </div>
      <div class="filter">
        <div class="filter-heading">
          <h2>{{ "types" | i18n }}</h2>
        </div>
        <ul class="filter-options">
          <li class="filter-option" [ngClass]="{ active: selectedType === sendType.Text }">
            <span class="filter-buttons">
              <button
                type="button"
                class="filter-button"
                (click)="selectType(sendType.Text)"
                [attr.aria-pressed]="selectedType === sendType.Text"
              >
                <i class="bwi bwi-fw bwi-file-text" aria-hidden="true"></i>&nbsp;{{
                  "sendTypeText" | i18n
                }}
              </button>
            </span>
          </li>
          <li class="filter-option" [ngClass]="{ active: selectedType === sendType.File }">
            <span class="filter-buttons">
              <button
                type="button"
                class="filter-button"
                (click)="selectType(sendType.File)"
                [attr.aria-pressed]="selectedType === sendType.File"
              >
                <i class="bwi bwi-fw bwi-file" aria-hidden="true"></i>&nbsp;{{
                  "sendTypeFile" | i18n
                }}
              </button>
            </span>
          </li>
        </ul>
      </div>
    </div>
    <app-nav class="nav"></app-nav>
  </div>
  <div id="items" class="items">
    <div class="content">
      <div class="list full-height" *ngIf="filteredSends.length">
        <button
          type="button"
          *ngFor="let s of filteredSends"
          appStopClick
          (click)="selectSend(s.id)"
          title="{{ 'viewItem' | i18n }}"
          (contextmenu)="viewSendMenu(s)"
          [ngClass]="{ active: s.id === sendId }"
          [attr.aria-pressed]="s.id === sendId"
          class="flex-list-item"
        >
          <span class="item-icon" aria-hidden="true">
            <i class="bwi bwi-fw bwi-lg" [ngClass]="s.type == 0 ? 'bwi-file-text' : 'bwi-file'"></i>
          </span>
          <span class="item-content">
            <span class="item-title">
              {{ s.name }}
              <span class="title-badges">
                <ng-container *ngIf="s.disabled">
                  <i
                    class="bwi bwi-exclamation-triangle"
                    appStopProp
                    title="{{ 'disabled' | i18n }}"
                    aria-hidden="true"
                  ></i>
                  <span class="sr-only">{{ "disabled" | i18n }}</span>
                </ng-container>
                <ng-container *ngIf="s.password">
                  <i
                    class="bwi bwi-key"
                    appStopProp
                    title="{{ 'password' | i18n }}"
                    aria-hidden="true"
                  ></i>
                  <span class="sr-only">{{ "password" | i18n }}</span>
                </ng-container>
                <ng-container *ngIf="s.maxAccessCountReached">
                  <i
                    class="bwi bwi-exclamation-triangle"
                    appStopProp
                    title="{{ 'maxAccessCountReached' | i18n }}"
                    aria-hidden="true"
                  ></i>
                  <span class="sr-only">{{ "maxAccessCountReached" | i18n }}</span>
                </ng-container>
                <ng-container *ngIf="s.expired">
                  <i
                    class="bwi bwi-clock"
                    appStopProp
                    title="{{ 'expired' | i18n }}"
                    aria-hidden="true"
                  ></i>
                  <span class="sr-only">{{ "expired" | i18n }}</span>
                </ng-container>
                <ng-container *ngIf="s.pendingDelete">
                  <i
                    class="bwi bwi-trash"
                    appStopProp
                    title="{{ 'pendingDeletion' | i18n }}"
                    aria-hidden="true"
                  ></i>
                  <span class="sr-only">{{ "pendingDeletion" | i18n }}</span>
                </ng-container>
              </span>
            </span>
            <span class="item-details">{{ s.deletionDate | date }}</span>
          </span>
        </button>
      </div>
      <div class="no-items" *ngIf="!filteredSends.length">
        <i class="bwi bwi-spinner bwi-spin bwi-3x" *ngIf="!loaded" aria-hidden="true"></i>
        <ng-container *ngIf="loaded">
          <img class="no-items-image" aria-hidden="true" />
          <p>{{ "noItemsInList" | i18n }}</p>
        </ng-container>
      </div>
      <div class="footer">
        <button
          type="button"
          (click)="addSend()"
          class="block primary"
          appA11yTitle="{{ 'addItem' | i18n }}"
        >
          <i class="bwi bwi-plus bwi-lg" aria-hidden="true"></i>
        </button>
      </div>
    </div>
  </div>
  <app-send-add-edit
    id="addEdit"
    class="details"
    *ngIf="action == 'add' || action == 'edit'"
    [sendId]="sendId"
    [type]="selectedSendType"
    (onSavedSend)="savedSend($event)"
    (onCancelled)="cancel($event)"
    (onDeletedSend)="deletedSend($event)"
  ></app-send-add-edit>
  <div class="logo" *ngIf="!action">
    <div class="content">
      <div class="inner-content">
        <img class="logo-image" alt="Bitwarden" aria-hidden="true" />
      </div>
    </div>
  </div>
</div>
